/*HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
 H       process.h
 H       Application name: Program Control Block Header File
 H       Programmers names: Thach Nguyen
 H       Date completed:
 H       Brief Description: This is the header file that defines an ADT for any given process.
 H
 HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH*/
#ifndef PROCESS_H_INCLUDED
#define PROCESS_H_INCLUDED
#define PRODUCER 10
#define CONSUMER 11
#define IDL 9
#define CALCULATE 8
#define IO 7
#define KEYBOARD 6

typedef struct process_str {
    int type;
	int	no_steps;		// number of time steps before resetting to 0 - number of instructions
	int no_requests;	// number of requests that will be generated during the process run
	int * requests;		// an array of requests, each request (e.g. io service) is issued at a specific
						// time step. These are the synchronous events that result in traps being issued.
						// You can get fancy and make this an array of RequestTypeStr which contains the
						// step number when issued, and a request type (e.g. 0=io, 1=sync, etc.)
    int priority;       //The priority of this process in comparison to others.
} ProcessStr;

typedef ProcessStr * Process;

extern Process process_init(int, int, int, int *, int);
extern void process_destroy(Process); //Frees the memory allocated to the process and reassigns it to the NULL pointer.
                                        //Note does not take responsibility for freeing any allocated memory passed to it.

#endif // PROCESS_H_INCLUDED
